<?php
namespace App\Admin\Renderable;

use App\Admin\Repositories\AdminSchool;
use Dcat\Admin\Grid;
use Dcat\Admin\Grid\LazyRenderable;

class SchoolTable extends LazyRenderable
{
    public function grid(): Grid
    {
        return Grid::make(AdminSchool::with('user'), function (Grid $grid) {
            $grid->column('id');
            $grid->column('school_name','学校名称');
            $grid->column('user.name','联系人');
            $grid->column('user.phone','联系电话');

            $grid->quickSearch(['school_name']);

            $grid->paginate(10);
            $grid->disableActions();
        });
    }
}
